///PHILOTES Source Code.  (C)2012 PhiloLabs
#pragma once

#ifndef __ConfigFile_H__
#define __ConfigFile_H__

#include "OgrePrerequisites.h"

#include "OgreString.h"
#include "OgreStringVector.h"
#include "OgreIteratorWrappers.h"
#include "OgreDataStream.h"

namespace Ogre {

	
	
	
	class _OgreExport ConfigFile : public MemAlloc_General
    {
    public:

        ConfigFile();
        virtual ~ConfigFile();
        /// load from a filename (not using resource group locations)
        void load(const String& filename, const String& separators = "\t:=", bool trimWhitespace = true);
        /// load from a filename (using resource group locations)
        void load(const String& filename, const String& resourceGroup, const String& separators = "\t:=", bool trimWhitespace = true);
        /// load from a data stream
        void load(const DataStreamPtr& stream, const String& separators = "\t:=", bool trimWhitespace = true);
		/// load from a filename (not using resource group locations)
		void loadDirect(const String& filename, const String& separators = "\t:=", bool trimWhitespace = true);
		/// load from a filename (using resource group locations)
		void loadFromResourceSystem(const String& filename, const String& resourceGroup, const String& separators = "\t:=", bool trimWhitespace = true);

        
        String getSetting(const String& key, const String& section = StringUtil::BLANK, const String& defaultValue = StringUtil::BLANK) const;
        
        StringVector getMultiSetting(const String& key, const String& section = StringUtil::BLANK) const;

        typedef multimap<String, String>::type SettingsMultiMap;
        typedef MapIterator<SettingsMultiMap> SettingsIterator;
        
        typedef map<String, SettingsMultiMap*>::type SettingsBySection;
        typedef MapIterator<SettingsBySection> SectionIterator;
        
        SectionIterator getSectionIterator(void);
        
        SettingsIterator getSettingsIterator(const String& section = StringUtil::BLANK);


        
        
        void clear(void);
    protected:
        SettingsBySection mSettings;
    };
	
	

}


#endif
